package zgs;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Note {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("note.txt");
        Scanner scan = new Scanner(System.in);
        System.out.print("请输入:");
        while(true){
            String s = scan.nextLine();
            if("exit".equals(s)){
                System.out.println("再见！");
                break;
            }
            byte[] data = s.getBytes(StandardCharsets.UTF_8);
            fos.write(data);
        }
        fos.close();
    }
}
